package cn.myjerry.sort.refType;

import java.util.ArrayList;
import java.util.Collections;
import java.util.Date;
import java.util.List;

/**
 * 使用Collections
 * @author Jerry
 *
 */

public class NewsItemApp {
	public static void main(String[] args) {
		List<NewsItem> list = new ArrayList<NewsItem>();
		list.add(new NewsItem("共享单车", 100, new Date()));
		list.add(new NewsItem("共享汽车", 50, new Date(System.currentTimeMillis() - 1000*60*60)));
		list.add(new NewsItem("共享充电宝", 60, new Date(System.currentTimeMillis() - 1000*60*60)));
		System.out.println("排序前："+list);
		
		System.out.println("++++++++++++++++++++++++++++++++++++");
		Collections.sort(list);
		System.out.println("排序后："+list);
	}
}
